﻿package kliment.display.draw.shape {
	import flash.geom.Point;
	import kliment.display.draw.DrawStyle;
	
	/**
	 * ...
	 * @author Kliment
	 */
	public class TriangleByEdgeShape extends ShapeAbstract {
		
		public function TriangleByEdgeShape(a:Number, b:Number, c:Number, drawStyle:DrawStyle = null) {
			super();
			_setStyles(graphics, drawStyle);
			graphics.moveTo(0, Math.abs(a * Math.sin(b)));
			graphics.lineTo(c, Math.abs(a * Math.sin(b)));
			graphics.lineTo(c - Math.sqrt(b * b - Math.abs(a * Math.sin(b)) * Math.abs(a * Math.sin(b))), 0);
			graphics.lineTo(0, Math.abs(a * Math.sin(b)));
			graphics.endFill();
		}
		
	}
	
}